package com.aaa.web.controller.carrecyclecontroller;


import com.aaa.web.commons.CarRecycleQuery;
import com.aaa.web.service.carrecycleservice.CarRecycleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Map;

/**
 * @program: battery
 * @description: 车辆回收
 * @author: liangyongzhen
 * @create: 2018-12-25 10:04
 **/
@Controller
@RequestMapping("/webrecycle")
public class CarRecycleController {

    @Autowired
    public CarRecycleService carRecycleService;
    
    @RequestMapping("/showCarRecycleList")
    public String showCarRecycleList(){
        return "views/webhtml/carrecycle/showrecyclelist";
    }

    /**
    * @Description: 电动车回收单
    * @Param: []
    * @return: java.util.List<com.aaa.entity.BackRecycle>
    * @Author: liangyongzhen
    * @Date: 2018/12/25
    */ 
    @RequestMapping("/getAllCarList")
    @ResponseBody
    public Map getAllCarList(CarRecycleQuery query){
        Map m = carRecycleService.getAllCarList(query);
        return m;
    }

    /**
    * @Description: 根据手机号搜索
    * @Param: [query]
    * @return: com.aaa.entity.BackRecycle
    * @Author: liangyongzhen
    * @Date: 2018/12/25
    */ 
    @RequestMapping("/getCarListByTel")
    @ResponseBody
    public Map getCarListByTel(CarRecycleQuery query){
        Map m = carRecycleService.getCarListByTel(query);
        return m;
    }

    /**
    * @Description: 拒绝申请
    * @Param: [query]
    * @return: java.util.Map
    * @Author: liangyongzhen
    * @Date: 2018/12/26
    */ 
    @RequestMapping("/refuseApply")
    @ResponseBody
    public Map refuseApply(CarRecycleQuery query){
        Map map = carRecycleService.refuseApply(query);
        return map;
    }

    /**
    * @Description: 同意申请
    * @Param: [query]
    * @return: java.util.Map
    * @Author: liangyongzhen
    * @Date: 2018/12/26
    */ 
    @RequestMapping("/dealApply")
    @ResponseBody
    public Map dealApply(CarRecycleQuery query){
        Map map = carRecycleService.dealApply(query);
        return map;
    }

    /**
    * @Description: 更新价格
    * @Param: [query]
    * @return: java.util.Map
    * @Author: liangyongzhen
    * @Date: 2018/12/26
    */ 
    @RequestMapping("/updatePrice")
    @ResponseBody
    public Map updatePrice(CarRecycleQuery query){
        Map map = carRecycleService.updatePrice(query);
        return map;
    }

    /**
    * @Description: 历史记录
    * @Param: [query]
    * @return: java.util.Map
    * @Author: liangyongzhen
    * @Date: 2018/12/26
    */ 
    @RequestMapping("/getReCycleDetail")
    @ResponseBody
    public Map getReCycleDetail(CarRecycleQuery query){
        Map map = carRecycleService.getReCycleDetail(query);
        return map;
    }

    /**
     * @Description: 根据手机号搜索历史
     * @Param: [query]
     * @return: com.aaa.entity.BackRecycle
     * @Author: liangyongzhen
     * @Date: 2018/12/25
     */
    @RequestMapping("/getCarHistoryByTel")
    @ResponseBody
    public Map getCarHistoryByTel(CarRecycleQuery query){
        Map m = carRecycleService.getCarHistoryByTel(query);
        return m;
    }

}
